﻿using System;
using System.Runtime.Serialization;

[Serializable()]
[DataContractAttribute(IsReference = true, Namespace="http://zombator.ru/services/smartdating")]
public class PersonalData {
    public static PersonalData CreatePersonalData(global::System.Guid usr_id, global::System.String first_name, global::System.Int32 gender, global::System.DateTime date_of_birth, global::System.Int32 orientation, global::System.Int32 reason, global::System.String bio) {
        PersonalData personalData = new PersonalData();
        personalData.usr_id = usr_id;
        personalData.first_name = first_name;
        personalData.gender = gender;
        personalData.date_of_birth = date_of_birth;
        personalData.orientation = orientation;
        personalData.reason = reason;
        personalData.bio = bio;
        return personalData;
    }

    [DataMemberAttribute()]
    public Guid usr_id { get; set; }

    [DataMemberAttribute()]
    public string first_name { get; set; }
    [DataMemberAttribute()]
    public string last_name { get; set; }

    [DataMemberAttribute()]
    public int gender { get; set; }

    [DataMemberAttribute()]
    public DateTime date_of_birth { get; set; }

    [DataMemberAttribute()]
    public Nullable<int> u_height { get; set; }
    [DataMemberAttribute()]
    public Nullable<int> u_weight { get; set; }

    [DataMemberAttribute()]
    public Nullable<int> hair_color { get; set; }
    [DataMemberAttribute()]
    public Nullable<int> eye_color { get; set; }

    [DataMemberAttribute()]
    public Nullable<int> main_size { get; set; }

    [DataMemberAttribute()]
    public Nullable<int> chest { get; set; }
    [DataMemberAttribute()]
    public Nullable<int> waist { get; set; }
    [DataMemberAttribute()]
    public Nullable<int> hip { get; set; }

    [DataMemberAttribute()]
    public int orientation { get; set; }

    [DataMemberAttribute()]
    public Nullable<int> zodiac { get; set; }

    [DataMemberAttribute()]
    public int reason { get; set; }
    [DataMemberAttribute()]
    public string interests { get; set; }
    [DataMemberAttribute()]
    public string bio { get; set; }

    [DataMemberAttribute()]
    public byte[] picture { get; set; }

    [DataMemberAttribute()]
    public string phone_number { get; set; }
    [DataMemberAttribute()]
    public string icq { get; set; }
    [DataMemberAttribute()]
    public string jabber { get; set; }

    private string n(Object obj) {
        if (obj != null)
            return obj.ToString();
        else
            return "null";
    }

    public override string ToString() {
        string picLength;
        if (picture == null) {
            picLength = "null";
        } else {
            picLength = picture.Length.ToString();
        }
        return String.Format(@"PersonalData(first_name = {0}, last_name = {1},
    gender = {2}, date_of_birth = {3}, u_height = {4}, u_weight = {5}, hair_color = {6},
    eye_color = {7}, main_size = {8}, chest = {9}, waist = {10}, hip = {11},
    orientation = {12}, zodiac = {13}, reason = {14}, interests = {15}, bio = {16},
    picture.Length = {17}, phone_number = {18}, icq = {19}, jabber = {20})",
            first_name, n(last_name), gender, date_of_birth, u_height.GetValueOrDefault(), u_weight.GetValueOrDefault(), 
            n(hair_color), n(eye_color), n(main_size), chest.GetValueOrDefault(), waist.GetValueOrDefault(), 
            hip.GetValueOrDefault(), orientation, zodiac.GetValueOrDefault(), reason, n(interests), bio,
            picLength, n(phone_number), n(icq), n(jabber));
    }
}

